<%@ page language="java" contentType="text/html; charset=utf-8"%>
<%@ include file="common/commonTopOther.jsp"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib uri="/struts-tags" prefix="s"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>My JSP 'ChangeInformations.jsp' starting page</title>
<script type="text/javascript">
 function CheckInput()
      //校验上传的文件是否为空，是否符合格式
      {
      //获取上传文件的url
        var file =encodeURI(document.getElementById("file").value);
       // if(file == "") {
          // alert("文件不能为空!");
           //返回false，不继续执行下一步
       //    return false; 
       // }else{     
       if(file != ""){
           //获取上传文件的后缀名
           var extension = file.substring(file.lastIndexOf('.'), file.length).toLowerCase();
           //判断后缀名是否符合图片格式".jpg|.jpeg|.gif|.bmp|.png"
           if(extension==".png"||extension==".jpg"||extension==".jpeg"||extension==".gif"||extension==".bmp"){
           //返回true，继续执行下一步
           return true;
           }else{
           alert("上传的文件格式不对");
           //返回false，不继续执行下一步
           return false;
           }             
        }  
      }    
</script>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
</head>
<body>
<center style="margin-top:70px;">
<div style="float:center;">
	<s:form action="update_updateInformations" enctype="multipart/form-data" namespace="/" method="post">
	
	    <s:iterator  value="#session.user" >
		<!-- 这是隐藏表单，用于传userName -->	
		<input type="hidden" name="userName" value="<s:property value="userName"/>" />
		<input type="hidden" name="photo" value="<s:property value="photo"/>" />
		
		  <div class="wow fadeInLeft" data-wow-delay="0.4s" style="margin-left:120px;">
			<span style="color: #080808;"></span><img src="images/avatar.png"
									width="100px" height="100px" />
			<input  type="file" name="image" id="file">
		  </div>
		  
		<div class="wow fadeInLeft" data-wow-delay="0.4s">
			<span style="color: #080808;">联系方式:</span>
			<input type="text" name="telephone" value="<s:property value="telephone"/>">
		  </div>
		
		<div class="wow fadeInLeft" data-wow-delay="0.4s">
			<span style="color: #080808;">联系地址:</span>
			<input type="text" name="address" value="<s:property value="address"/>" >
		  </div>
	
	<div class="wow fadeInLeft" data-wow-delay="0.4s">
			<span style="color: #080808;">个人说明:</span>
			<input type="text" name="informations.personlySay" value="<s:property value="#session.personlySay"/>">
		  </div>
		
		  <div class="wow fadeInLeft" data-wow-delay="0.4s">
			<span style="color: #080808;">志愿口号:</span>
			<input type="text" name="informations.volunteerSlogan" value="<s:property value="#session.volunteerSlogan"/>" >
		  </div>
		
		</s:iterator>
		<br>
		<td colspan="2"><input type="submit" value="修改" onclick="return CheckInput()"/>
		
		</s:form><br>
		<a href="lookPersonlyCenter.jsp">返回上一层</a>
		</div>
</center>		
</body>
</html>
<%@ include file="common/commonBottom.jsp"%>